package com.ks.composestudy.ui

import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.ks.composestudy.MainViewModel

@Composable
fun ChatPage(viewModel: MainViewModel) {
    val offsetXPercent: Float by animateFloatAsState(if (viewModel.chatting) 0f else 1f)
    Box(
        Modifier
            .offsetPercent(offsetXPercent)
            .fillMaxSize()
            .background(Color.Magenta)
    ) {
        Column {
            viewModel.currentChat?.let { ChatBarTop(it, viewModel) }
//            ChatContent()
//            ChatBarBottom()
        }
    }
}

